import React from 'react'
import './style.css'

class CartItem extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            num: 0
        }
    }
    changeState = (k, v) => {
        this.setState({ [k]: v })
    }
    render() {
        const { num } = this.state
        return (
            <div className='cartItem' >
                <div className='cartItem-wrap'>
                    <div className='cartItem-body'>
                        <div className='cartItem-body-radio cartItem-body-radio_active' >
                            <i className='iconfont icon-danyehuaban'></i>
                        </div>
                        <div className='cartItem-body-info'>
                            <img src="https://xinglong.tech/logo.jpg" />
                            <div className='cartItem-body-info_details' >
                                <span>
                                    IT外包服务
                                </span>
                                <span className='price'>
                                    ¥99.99
                                </span>
                            </div>
                        </div>
                        <div className='cartItem-body-ctrl'>
                            <span className='iconfont icon-jian' ></span>
                            <input 
                                value={num} 
                                onChange={e => this.changeState('num', e.target.value)} 
                            />
                            <span className='iconfont icon-ziyuan' ></span>
                        </div>
                    </div>
                    <div className='cartItem-del'>
                        <div>
                            <i className='iconfont icon-del'></i>
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}

export default CartItem
